//
//  SHKuai100ViewController.m
//  youjian03
//
//  Created by 常琼 on 14/11/11.
//  Copyright (c) 2014年 com.shouhuobao. All rights reserved.
//

#import "SHKuai100ViewController.h"

@interface SHKuai100ViewController ()<UIWebViewDelegate>
@property (weak, nonatomic) IBOutlet UIWebView *webView;

@end

@implementation SHKuai100ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    //"我的寄件"标题
    //添加一个有件快递按钮
    UIButton *youjian =  [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 69, 17)];
    [youjian setTitle:@"快递查询" forState:UIControlStateNormal];
    [youjian setTitleColor:[UIColor redColor] forState: UIControlStateNormal];
    [youjian setFont:[UIFont fontWithName:@"Helvetica-Bold" size:20]];
    youjian.userInteractionEnabled = NO;
    self.navigationItem.titleView = youjian;
    
    
    //添加左侧按钮
    self.navigationItem.leftBarButtonItem = [UIBarButtonItem itemWithImageName:@"back" highImageName:@"back" target:self action:@selector(leftButton)];
    
    
    if(self.typeNo ==nil)
    {
        self.typeNo = @"";
    }
    if (self.postId ==nil)
    {
        self.postId = @"";
    }
    

    NSString *urlstr = [NSString stringWithFormat:@"http://m.kuaidi100.com/index_all.html?type=%@&postid=%@",self.typeNo,self.postId];
    
    

    
    // webview加载网页
    self.webView.delegate =self;
    
    [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:urlstr]]];
 
}
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
{
    return YES;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
-(void)leftButton
{
    [self.navigationController popViewControllerAnimated:YES];
    
}


@end
